﻿namespace NJQuery.Configuration {
	using System.Configuration;
	using System.Diagnostics.CodeAnalysis;

	/// <summary>
	/// Defines configuration settings pertaining to client script libraries managed by the jQuery <see cref="Manager"/>.
	/// This class cannot be inherited.
	/// </summary>
	public sealed class ClientScriptsSection : ConfigurationElement {


		#region Constructors

		/// <summary>
		/// This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
		/// Creates a new instance of the <see cref="ClientScriptsSection"/> class.
		/// </summary>
		public ClientScriptsSection() { }

		#endregion


		#region Properties

		/// <summary>
		/// Gets or sets the root URL which all scripts configured in the <see cref="References"/> collection can be defined relative to in addition to the default URLs given to any script library URLs not defined in the section.
		/// </summary>
		[ConfigurationProperty("baseUrl", DefaultValue = "~/scripts/jquery/", IsRequired = false)]
		[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings", Justification = "This is for a settings file.")]
		public string BaseUrl {
			get { return this["baseUrl"] as string; }
			set { this["baseUrl"] = value; }
		}

		/// <summary>
		/// Gets a collection providing the ability to define custom URLs for all script libraries used by the jQuery server controls.
		/// </summary>
		[ConfigurationProperty("references")]
		public ClientScriptCollection References {
			get { return this["references"] as ClientScriptCollection; }
		}

		#endregion


	}

}